#pragma once
#include "types.h"
#include "message.h"

class CInterleaver
{
public:
    CInterleaver();

	bool Interleave(CMessage &msg);
	bool Interleave(double* arry, uint32_t size);
    
	bool DeInterleave(CMessage &msg);
	bool DeInterleave(double* arry, uint32_t size);
	
	uint32_t GetInterleavedIndex(uint32_t index){
		if(index>mSize){
			return mSize;
		}else{
			return mInterleaveIndex[index];
		}
	};

	uint32_t GetDeInterleavedIndex(uint32_t index){
		if(index>mSize){
			return mSize;
		}else{
			return mDeInterleaveIndex[index];
		}
	};
    ~CInterleaver(void);    

//protected:
public: //for debuggin reasons
    uint32_t*           mInterleaveIndex;
	uint32_t*           mDeInterleaveIndex;
    uint32_t            mSize;

};